<?php include_once __DIR__.'/left.html';?>
<div class="layui-body">
  <!-- 内容主体区域 -->
  <div style="padding: 15px;">
    <blockquote class="layui-elem-quote">你的微信联系方式,将会出现在网站的个人中心. 方便好友添加</blockquote>
<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <form class="layui-form" action="<?=url('admin/connect');?>">
            <input type="hidden" name="id" value="<?=$userinfo['id']?>" />

            <div class="layui-form-item">
              <label class="layui-form-label">微信号</label>
              <div class="layui-input-inline">
                <input type="text" name="wxid" required  lay-verify="required" placeholder="请输入微信号" value="<?=$userinfo['wxid']?>" autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">打开微信, 点击我. 顶部有微信号</div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">微信二维码</label>
              <div class="layui-input-block">
                  <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="myupimg">
                    <i class="layui-icon">&#xe67c;</i>上传图片
                  </button>
                  <input type="hidden" name="pic" value="<?=$userinfo['pic_wx_qrcode']?>" />
                  <br>
                  <br>
                  <div style="display:inline-block;position:relative;">
                      <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;<?php if(!$userinfo['pic_wx_qrcode']):?>display:none;<?php endif;?>" id="closeimg">x</span>
                      <img id="pic" height=100 src="<?=$userinfo['pic_wx_qrcode']?>" />
                  </div>
              </div>
            </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="myform">立即提交</button>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
</div>
</div>
<script>
layui.use(['form'], function(){
  var $ = layui.$
  ,form = layui.form;
  form.render();
});
</script>
